#!/usr/bin/env bash
#dev-install.sh

sudo apt update

sudo apt install -y wget unzip openssl curl

#TODO how to get mariadb on different linux version
sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8
#sudo add-apt-repository 'deb [arch=amd64,i386] http://mirrors.tuna.tsinghua.edu.cn/mariadb/repo/10.1/debian sid main'
#sudo add-apt-repository 'deb [arch=amd64,i386] http://mirrors.tuna.tsinghua.edu.cn/mariadb/repo/10.1/debian jessie main'
#sudo add-apt-repository 'deb [arch=amd64,i386] http://mirrors.tuna.tsinghua.edu.cn/mariadb/repo/10.1/debian wheezy main'

#sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://mirrors.tuna.tsinghua.edu.cn/mariadb/repo/10.1/ubuntu xenial main'
#sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://mirrors.tuna.tsinghua.edu.cn/mariadb/repo/10.1/ubuntu trusty main'
#sudo add-apt-repository 'deb [arch=amd64,i386] http://mirrors.tuna.tsinghua.edu.cn/mariadb/repo/10.1/ubuntu precise main'

sudo apt-get update
sudo apt install -y MariaDB-server MariaDB-client
#apt install -y mysql-server mysql-client

echo "as you know, there is firefox in the system, so let's begin installing chrome ..."
if [ "$(uname -m)" = "x86_64" ]; then
    wget -c https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.deb
    sudo rpm -i google-chrome-stable_current_x86_64.deb
else
    #TODO chang it to i386
    wget -c https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.deb
    sudo rpm -i google-chrome-stable_current_x86_64.deb
fi

echo "vscode and atom is style，O(∩_∩)O"
wget -c https://az764295.vo.msecnd.net/stable/5be4091987a98e3870d89d630eb87be6d9bafd27/code_1.5.3-1474533365_amd64.deb
sudo rpm -i code-1.5.1-1473370243.el7.x86_64.deb
#wget -c https://github-cloud.s3.amazonaws.com/releases/3228505/4d8e003e-7506-11e6-8c1b-69e64d1becbe.rpm?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ%2F20160910%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20160910T075002Z&X-Amz-Expires=300&X-Amz-Signature=f01691687108b52df2f5de610753971adab5f0bfdff16c35d2b8d1457f33e56e&X-Amz-SignedHeaders=host&actor_id=14797057&response-content-disposition=attachment%3B%20filename%3Datom.x86_64.rpm&response-content-type=application%2Foctet-stream
#rpm -i atom.x86_64.rpm
#something wrong

echo "git svn which is yours? download all ..."
sudo apt install git subversion -y

echo "let's begin install docker ..."

#On Debian Wheezy
#sudo echo "echo deb https://apt.dockerproject.org/repo debian-wheezy main" > //etc/apt/sources.list.d/docker.list

#On Debian Jessie
#sudo echo "deb https://apt.dockerproject.org/repo debian-jessie main" > //etc/apt/sources.list.d/docker.list

#On Debian Stretch/Sid
#sudo echo "deb https://apt.dockerproject.org/repo debian-stretch main" > //etc/apt/sources.list.d/docker.list
sudo apt-get update
sudo sudo apt install docker-engine

echo "how about something fun?"
sudo apt install gimp inkscape dia zhcon blender
#网易云音乐 (●'◡'●)
wget -c http://s1.music.126.net/download/pc/netease-cloud-music_1.0.0-1_amd64_deepin15.deb
#http://s1.music.126.net/download/pc/netease-cloud-music_1.0.0_amd64_ubuntu16.04.deb
sudo rpm -i netease-cloud-music_1.0.0-1_amd64_deepin15.deb